package com.sise.bl.dao.impl;

import com.sise.bl.dao.AdminDao;
import com.sise.bl.entity.Type;
import com.sise.bl.entity.User;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Repository;

@Repository("adminDao")
public class AdminDaoImpl extends BaseDaoImpl implements AdminDao {

    @Override
    public void deleteUserById(User user) {
        this.getCurrentSession().delete(user);
    }

    @Override
    public int deleteType(Type type) {
        try {
            this.getCurrentSession().delete(type);
            return 1;
        } catch (DataAccessException e) {
            e.printStackTrace();
            return 0;
        }
    }
}
